import request from "@/utils/request";
import * as product from "./product/index.js";
import * as data from "./data";

// 登录请求方法
export const auth = (data) => request.post("/token-auth/", data);

// 退出网站
export const logout = () => request.get("/logout");

export const getMenu = () => request.get("/admin/menu/tree");

export const getActions = (params) => request.get("/action", { params });

export const uploadImage = (data) => request.post("/image/", data);

export const getUserInfo = () => request.get("/user/");

export const getWhiteList = () => request.get("/admin/menu/");

export default {
  auth,
  logout,
  getMenu,
  getActions,
  uploadImage,
  ...product,
  ...data,
};
